#！/bin/bash
# '开始部署'
export BUILD_ID=dontKillMe
JAR_PATH=/home/admin/application/target
[ ! -e $JAR_PATH ] && mkdir -p $JAR_PATH
JAR_NAME=demo-0.0.1-SNAPSHOT.jar

process_id=$(ps -ef|grep $JAR_NAME | awk '{print $2}')
echo $process_id
if [[ ! -z $process_id ]]
then
  echo 'stop'
  kill -9 $process_id
else
  echo 'spring not start'
fi
cd $JAR_PATH
nohup java -jar $JAR_NAME >springboot.log &
echo 'springboot stater'
